<template>
    <div>
        <el-dialog title="分配权限" :visible.sync="limitShow">
            <el-tree :data="treeList" show-checkbox node-key="id" :default-expanded-keys="[2, 3]"
                :default-checked-keys="limitList" :props="defaultProps" :default-expand-all="true">
            </el-tree>

            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
import { RolesList } from '@/api/roles'
export default {
    props: {
        limitShow: {
            type: Boolean
        },
        roleList: {
            type: Array
        }
    },
    data() {
        return {
            rolesList: {},
            treeList: [],
            defaultProps: {
                children: 'children',
                label: 'authName'
            }
        };
    },
    computed: {
        limitList() {
            return this.roleList.forEach(item => {
                console.log(item);
            })
        }
    },
    created(){
        console.log(this.limitList);
    },
    methods: {
        async RolesList() {
            let res = await RolesList()
            this.treeList = res
          
        }
    }
}
</script>

<style lang="scss" scoped>

</style>